Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
ReactJs in static production: White page "Typeerror: Object(...) is not a function"

I have a ReactJs project that has been testet and works perfectly in development.

I am now trying to host it on an Apache Server on my Ubuntu based VPS. Routing works fine apparently, one simple "about page" is loading fine. But all other routes result in a blank white page, and the following console errors: enter image description here

I suspect something might be wrong with dependencies: An example depency list for a non-working component looks like this:

import { Row, Col } from 'antd';
import { useNavigate } from "react-router-dom";
import BouncingBox from '../../components/bouncing-box/bouncing-box.jsx';
import RoundedBtn from '../../components/rounded-btn/rounded-btn.jsx';
import { Input } from 'antd';
import { useState, useRef } from 'react';
import FirebaseService from '../../services/FirebaseService.js';
import SessionStorageService from '../../services/SessionStorageService.js'
import { useParams } from 'react-router';
import { useEffect } from 'react/cjs/react.development';

Does anyone know what could be causing the issue? It is a project based on create-react-app, so we are using webpack along with some custom libraries. Should be noted that I have tried hosting it on Netlify with the EXACT same result, so probably not a server configuration issue.

EDIT:

join-game.jsx line 27 refers to this code...

 useEffect(() => {
        if (inputstate == 1) isHosting.current = true
    }, [])
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So the issue for me was the import:

import { useEffect } from 'react/cjs/react.development';

Was auto generated. So I removed the line and I switched:

import { useState, useRef } from 'react';

To:

import { useState, useRef, UseEffect } from 'react';

Moral of the story: You can click the causing issue in dev tools and pretty print it, this will hint the file in which you should likely check your imports.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda